package com.feihao.zhou.TCP.demoFileUpLoadUseThreadPool;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.UUID;
import java.util.concurrent.*;

public class ServerDemo {
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(8808);

        while (true) {
            Socket accept = serverSocket.accept();

            SocketThread_01 socketThread_01 = new SocketThread_01(accept);
            /*socketThread_01.start();*/

            //创建线程池：
            ThreadPoolExecutor pool = new ThreadPoolExecutor(5,10,3,
                    TimeUnit.SECONDS,new ArrayBlockingQueue<>(10),
                    Executors.defaultThreadFactory(),new ThreadPoolExecutor.AbortPolicy());

            pool.submit(socketThread_01);
        }


    }
}
